
var LoginView = View.extend(LoginView = {

    init: function() {
        this._super();
        this.setupView();
    },
            
    setupView: function() {
        var self = this;

        $("#forgot_password_btn").click(function(e) {
            e.preventDefault();

            self.showForgotPasswordDialog();
        });
    },
            
    showForgotPasswordDialog: function() {
        var self = this;
        
        App.UI.showDialog({
            title: 'Forgot Password',
            width: 420,
            height: 210,
            content: $("#forgot_password_block").html(),
            buttons: {
                'Submit': function() {
                    self.sendPasswordResetLink();
                },
                'Cancel': function() {
                    App.UI.hideDialog();
                }
            }
        });
    },
    
    sendPasswordResetLink: function() {
        var email = $("#app_dialog #forgot_password_email").get(0).validate();
        
        if( !email ) {
            return false;
        }
    }
});

$(document).ready(function() {
    App.getController().setView(new LoginView());
});
